#include "monster.h"
#include "hero.h"
#include <iostream>
#include <string>
using namespace std;

Hero::Hero()
{
    setAll();
}

Hero::Hero(string nm)
{
    setAll(nm);
}

int Hero::battleAction(int code)
{
    char choice = '0';
    int answer;
    cout << "What should " << name << " do?\n";
    if(code == 1)
    {
        while (choice < 3 && choice > 0) //something's fishy
        {
            cout << "1. Use Normal Attack\n2. Use Magic Attack\n3. What's the difference???\n:";
            cin >> choice;
            switch( choice )
            {
                case 1:
                    answer = attack();
                    return answer;
                case 2:
                    answer = Mattack();
                    return answer;
                case 3:
                    cout << "\n\nMagic Attacks are often higher, but can't be used if you are out of mana.\n";
            }
        }
    }
    else
    {
        while (choice < 3 && choice > 0)
        {
            cout << "1. Use Normal Defense\n2. Use Magic Defense\n3. What's the difference???\n:";
            cin >> choice;
            switch( choice )
            {
                case 1:
                    answer = defend();
                    return answer;
                case 2:
                    answer = Mdefend();
                    return answer;
                case 3:
                    cout << "\n\nMagic Defense has a greater chance of blocking attacks, but can't be used if you are out of mana.\n";
            }
        }
    }

    return 0;
}

